package com.hup.utils.io.netty.handler.dataListener;


import com.hup.utils.io.netty.model.BaseDataPacket;
import lombok.extern.log4j.Log4j2;

/**
 * 简单打印[收发数据]的处理器;
 * 本类仅供参考,一般情况下需要自定义实现类,以处理不同类别的数据
 *
 * @author hugan
 * @date 2021/5/9
 */
@Log4j2
public class PrintDataListener implements IDataListener {

    @Override
    public void onReceived(BaseDataPacket packet, int dataLength) {
        //packet.getType() 过滤数据
        log.info("收到:{}", packet);
    }

    @Override
    public void onSend(BaseDataPacket packet, int dataLength) {
        //packet.getType() 过滤数据
        log.info("发送:{}", packet);
    }
}
